<template>
  <table class="ex-table" v-bind="widgetData.options">
    <tbody>
      <tr v-for="row in widgetData.children" :key="row.id">
        <template v-for="cell in row.children" :key="cell.id">
          <td v-if="cell.merged" class="ex-table_td">
            <template v-for="item in cell.children">
              <template v-if="item.category === 'container'">
                <component
                  :is="`${item.type}-item`"
                  :designer="designer"
                  :widget-data="item"
                  :form-data="formData"
                  :key="item.id"
                />
              </template>
              <template v-else>
                <form-item
                  :designer="designer"
                  :widget-data="item"
                  :form-data="formData"
                  :key="item.id"
                />
              </template>
            </template>
          </td>
        </template>
      </tr>
    </tbody>
  </table>
</template>

<script setup lang="ts">
import { renContainerProps } from "./container";

defineProps(renContainerProps);
</script>
